/*
 * @Author: wangchao
 * @Date: 2024-10-04 12:07:03
 * @LastEditors: wangchao
 * @LastEditTime: 2024-10-12 08:40:05
 * @FilePath: \JD-RTT-Driver\applications\u_utilits.h
 * @Description:
 * Copyright (c) 2024 by Bingshan Guardian, All Rights Reserved.
 */

#ifndef _U_UTILITS_H_
#define _U_UTILITS_H_

#include <rtdevice.h>
#include <rtthread.h>

#define u_bitSet(value, bit)             ((value) |= (1UL << (bit)))
#define u_bitClear(value, bit)           ((value) &= ~(1UL << (bit)))
#define u_bitWrite(value, bit, bitvalue) (bitvalue ? u_bitSet(value, bit) : u_bitClear(value, bit))

extern rt_int16_t int16_abs(rt_int16_t x);
extern rt_uint16_t median_filter_average_value(rt_uint16_t data[], rt_uint8_t len, rt_uint8_t abandon);

#endif
